package com.guigu.service.impl.manufacture;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.guigu.mapper.manufacture.MDesignProcedureDetailsMapper;
import com.guigu.pojo.manufacture.MDesignProcedureDetails;
import com.guigu.service.manufacture.MDesignProcedureDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Mr.Zhang
 * @since 2024-12-06
 */
@Service
public class MDesignProcedureDetailsServiceImpl extends ServiceImpl<MDesignProcedureDetailsMapper, MDesignProcedureDetails> implements MDesignProcedureDetailsService {

    @Autowired
    private MDesignProcedureDetailsMapper mDesignProcedureDetailsMapper;

    @Override
    public ArrayList<MDesignProcedureDetails> selectArrByParentId(Integer id) {
        QueryWrapper<MDesignProcedureDetails> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("PARENT_ID", id);
        queryWrapper.orderByAsc("DETAILS_NUMBER");
        ArrayList<MDesignProcedureDetails> mDesignProcedureDetails = (ArrayList<MDesignProcedureDetails>) mDesignProcedureDetailsMapper.selectList(queryWrapper);
        return mDesignProcedureDetails;
    }
}
